﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ThanhTu.GNC.Media.KQXS.DataAccess.BL;
using System.Data;

namespace GNCMedia.KQXS.UserControls
{
    public partial class ResultsLotteryUserControl : System.Web.UI.UserControl
    {

        public string choose = null;

        public string Choose
        {
            get { return choose; }
            set { choose = value; }
        }


        public void getResultByChooseDate(string chooseDate)
        {
            choose = chooseDate.ToString();
            DateTime dt = Convert.ToDateTime(choose);
            int rowCount = 0;
            try
            {
                ResultLotteryBL vResultLotteryBL = new ResultLotteryBL();
                Repeater.DataSource = vResultLotteryBL.SelectAll_KQ_User_date(dt, 1, 5, ref rowCount);
                Repeater.DataBind();
            }
            catch (Exception ex)
            {
                Response.Write(
                  "LỖI: " + ex.Message);
            }
            finally
            {

            }

        }

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                ResultLotteryBL vResultLotteryBL = new ResultLotteryBL();
                int rowCount = 0;
                DataTable dt = vResultLotteryBL.SelectAll_KQ_User(1, 5, ref rowCount);
                Repeater.DataSource = dt;
                Repeater.DataBind();
               
            }
            catch (Exception ex)
            {
                Response.Write(
                   "Default: " + ex.Message);
            }
        }
    }
}